package com.example.demo.pojo;

public class Score {
    private Integer studentId;
    private Integer grade;
    private Double toscore;

    // 思政成绩相关属性
    private Integer szbaseScore; // 思政基础
    private Integer szhoScore;   // 思政荣誉分
    private Integer szteScore;   // 导师评分

    // 科研成绩相关属性
    private Integer kylwScore;   // 论文
    private Integer kyzsScore;   // 知识产权
    private Integer kysmScore;   // 科研项目
    private Integer kyjsScore;   // 学科竞赛

    // 学业成绩相关属性
    private Integer xytoScore;   // 学生总分
    private Integer xycourseNum; // 学生科目

    // 社会服务成绩相关属性
    private Integer sebaseScore; // 社会服务基础
    private Integer sefjScore;   // 社会服务附加

    // 各分类分数
    private Double xyscore;
    private Integer szscore;
    private Integer kyscore;
    private Integer sescore;

    // 状态字
    private Integer temp;


    public Integer getStudentId() {
        return studentId;
    }

    public void setStudentId(Integer studentId) {
        this.studentId = studentId;
    }

    public Integer getGrade() {
        return grade;
    }

    public void setGrade(Integer grade) {
        if (grade != null && (grade == 3 || grade == 2 || grade == 1 )) {
            this.grade = grade;
        } else {
            throw new IllegalArgumentException("grade 只能输入 123");
        }
    }

    public Double getToscore() {
        return toscore;
    }

    public void setToscore(Double toscore) {
        this.toscore = toscore;
    }

    public Integer getSzbaseScore() {
        return szbaseScore;
    }

    public void setSzbaseScore(Integer szbaseScore) {
        this.szbaseScore = szbaseScore;
    }

    public Integer getSzhoScore() {
        return szhoScore;
    }

    public void setSzhoScore(Integer szhoScore) {
        this.szhoScore = szhoScore;
    }

    public Integer getSzteScore() {
        return szteScore;
    }

    public void setSzteScore(Integer szteScore) {
        this.szteScore = szteScore;
    }

    public Integer getKylwScore() {
        return kylwScore;
    }

    public void setKylwScore(Integer kylwScore) {
        if (kylwScore != null && (kylwScore == 30 || kylwScore == 25 || kylwScore == 20 || kylwScore == 15 || kylwScore == 10 || kylwScore == 5 || kylwScore == 0)) {
            this.kylwScore = kylwScore;
        } else {
            throw new IllegalArgumentException("kylwScore 只能输入 30、25、20、15、10、5、0");
        }
    }

    public Integer getKyzsScore() {
        return kyzsScore;
    }

    public void setKyzsScore(Integer kyzsScore) {
        if (kyzsScore != null && (kyzsScore == 5 || kyzsScore == 3 || kyzsScore == 2 || kyzsScore == 1 || kyzsScore == 0 )) {
            this.kyzsScore = kyzsScore;
        } else {
            throw new IllegalArgumentException("kyzsScore 只能输入 5、3、2、1、0");
        }
    }

    public Integer getKysmScore() {
        return kysmScore;
    }

    public void setKysmScore(Integer kysmScore) {
        this.kysmScore = kysmScore;
    }

    public Integer getKyjsScore() {
        return kyjsScore;
    }

    public void setKyjsScore(Integer kyjsScore) {
        this.kyjsScore = kyjsScore;
    }

    public Integer getSebaseScore() {
        return sebaseScore;
    }

    public void setSebaseScore(Integer sebaseScore) {
        if (sebaseScore != null && sebaseScore > 15) {
            sebaseScore = 15;
        }
        this.sebaseScore = sebaseScore;
    }

    public Integer getSefjScore() {
        return sefjScore;
    }

    public void setSefjScore(Integer sefjScore) {
        if (sefjScore != null && sefjScore > 5) {
            sefjScore = 5;
        }
        this.sebaseScore = sebaseScore;
        this.sefjScore = sefjScore;
    }

    public Integer getXycourseNum() {
        return xycourseNum;
    }

    public void setXycourseNum(Integer xycourseNum) {
        this.xycourseNum = xycourseNum;
    }

    public Integer getXytoScore() {
        return xytoScore;
    }

    public void setXytoScore(Integer xytoScore) {
        this.xytoScore = xytoScore;
    }

    public Double getXyscore() {
        return xyscore;
    }

    public void setXyscore(Double xyscore) {
        this.xyscore = xyscore;
    }

    public Integer getSzscore() {
        Integer szbaseScore = getSzbaseScore();
        Integer szhoScore = getSzhoScore();
        Integer szteScore = getSzteScore();

        if (szbaseScore != null && szhoScore != null && szteScore != null) {
            if (szbaseScore > 20) {
                szbaseScore = 20;
            }
            if (szhoScore > 5) {
                szhoScore = 5;
            }
            if (szteScore != 4 && szteScore != 5) {
                throw new IllegalArgumentException("szteScore 只能输入 4 分或者 5 分");
            }
            return szbaseScore + szhoScore + szteScore;
        }
        return null;
    }

    public void setSzscore(Integer szscore) {
        this.szscore = szscore;
    }

    public Integer getKyscore() {
        return kyscore;
    }

    public void setKyscore(Integer kyscore) {
        this.kyscore = kyscore;
    }

    public Integer getSescore() {
        Integer sebaseScore = getSebaseScore();
        Integer sefjScore = getSefjScore();

        if (sebaseScore != null && sefjScore != null) {
            int sescore = sebaseScore + sefjScore;
            if (sescore > 20) {
                sescore = 20;
            }
            return sescore;
        }
        return null;
    }

    public void setSescore(Integer sescore) {
        this.sescore = sescore;
    }

    public Integer getTemp() {
        return temp;
    }
    public void setTemp(Integer temp) {
        this.temp = temp;
    }



}